﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;

public partial class BackupDB : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            //SqlConnection sqlconn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
            //SqlCommand sqlcmd = sqlconn.CreateCommand();
            //sqlcmd.CommandType = CommandType.Text;
            //sqlcmd.CommandText = "Use Master BACKUP  DATABASE Periodical TO DISK= N'" + Server.MapPath("~\\mybackups\\Periodical.bak") + "'";


            //sqlconn.Open();
            //sqlconn.ChangeDatabase("Master");
            //sqlcmd.ExecuteNonQuery();
            //sqlconn.Close();
            Downloader1.FilePath = Request.MapPath("~\\mybackups\\Periodical.bak");
            Page.ClientScript.RegisterStartupScript(this.GetType(), "reports", " Sents();", true);

            
        }
    }

   
}
